local shibing = fk.CreateSkill{
  name = "sclan__shibing",
  tags = { Skill.Compulsory },
  attached_skill_name = "sclan__shibing_active&",
  derived_piles = "sclan__shibing",
}

Fk:loadTranslationTable{
  ["sclan__shibing"] = "石兵",
  [":sclan__shibing"] = "锁定技，一轮开始时，若你的武将牌上没有「石兵」，你将牌堆顶的八张牌置于武将牌上，称为「石兵」；"
  .."每名角色的出牌阶段限一次，其可以用一张手牌替换一张「石兵」，替换后的「石兵」置于末位。",
}

shibing:addAcquireEffect(function (self, player, is_start)
  local room = player.room
  table.forEach(room:getAlivePlayers(false), function (p)
    room:handleAddLoseSkills(p, "sclan__shibing_active&", shibing.name)
  end)
end)

shibing:addEffect(fk.RoundStart, {
  anim_type = "special",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(shibing.name) and #player:getPile(shibing.name) == 0
  end,
  on_cost = Util.TrueFunc,
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:moveCardTo(room:getNCards(8), Card.PlayerSpecial, player, fk.ReasonPut, shibing.name, shibing.name, true, player)
  end
})

return shibing